package com.atguigu.gmall.service.TreadPool;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Data
@ConfigurationProperties(prefix = "app.threadpool")
public class AppTreadPoolProperties {

    private Integer corePoolSize;
    private Integer maximumPoolSize;
    private Long keepAliveTime;
    private TimeUnit unit = TimeUnit.MINUTES;
    private Integer queueSize=1000;

    //如果没有异步能力,同步运行完
    private RejectedExecutionHandler RejectedHandler= new ThreadPoolExecutor.CallerRunsPolicy();




}
